package huangbiao;
import java.util.Arrays;
public class practice3 {
public static void main(String[] args) {
	int a[] = new int [] {7,3,4,2,9};
	  for(int s=1;s<a.length;s++) {
		  for(int d=0;d<a.length-s;d++) {
			  if(a[d]>a[d+1]) {
				  int e=a[d+1];
				  a[d+1]=a[d];
				  a[d]=e;
			  }
		  }
	  }
	  for(int f:a) {
	  System.out.print(f+",");
	  }
	  System.out.println();
	  int r= (a.length)/2;
	 for(int g=0;g<r;g++) {
		 int w=a[g];
		 a[g]=a[a.length-(g+1)];
		 a[a.length-(g+1)]=w;
	 }
	 for(int u:a) {
		 System.out.print(u+",");
	  }
}
	}

